package com.weitu.permission.district.service.impl;

import com.weitu.permission.district.entity.Province;
import com.weitu.permission.district.mapper.ProvinceMapper;
import com.weitu.permission.district.service.ProvinceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ProvinceServiceImpl implements ProvinceService {
    private final ProvinceMapper provinceMapper;

    private static final Logger logger = LoggerFactory.getLogger(ProvinceServiceImpl.class);

    @Autowired
    public ProvinceServiceImpl(ProvinceMapper provinceMapper) {
        this.provinceMapper = provinceMapper;
    }

    @Override
    public Province selectByPrimaryKey(String code) {
        return this.provinceMapper.selectByPrimaryKey(code);
    }

    @Override
    @Transactional
    public int deleteByPrimaryKey(String code) {
        return this.provinceMapper.deleteByPrimaryKey(code);
    }

    @Override
    @Transactional
    public int updateByPrimaryKeySelective(Province record) {
        return this.provinceMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    @Transactional
    public int insertSelective(Province record) {
        return this.provinceMapper.insertSelective(record);
    }

    @Override
    public List<Province> queryList(String code) {
        return this.provinceMapper.queryList(code);
    }
}